package com.yami.shop.service;

import cn.hutool.poi.excel.ExcelWriter;
import com.yami.shop.bean.model.Category;
import com.yami.shop.bean.param.ProdEffectParam;
import com.yami.shop.bean.param.ProductExportParam;
import com.yami.shop.common.bean.LangConfig;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 商品
 * @author yami
 */
public interface ProductExcelService{



    ExcelWriter getProdExcelWriter(Long shopId, LangConfig langConfig, boolean template);


    int writerProdToExcel(List<ProductExportParam> products, ExcelWriter writer, Long shopId, Integer row, Map<Long, String> categoryMap, LangConfig langConfig);

    /**
     * 下载模板
     * @param response 响应信息
     * @param shopId 店铺id
     */
    void downloadModel(HttpServletResponse response, Long shopId);

    /**
     * 导入文件
     * @param excelFile 前端传过来的文件信息
     * @param shopId 店铺id
     * @param isSameCity 是否开启同城配送
     * @param employeeId 员工id
     * @param prodIds 导入成功后生成的商品id集合
     * @return 结果
     * @throws Exception 异常
     */
    Object parseFile(MultipartFile excelFile, Long shopId, Long employeeId, List<Long> prodIds,boolean isSameCity) throws Exception;


    /**
     * 导出商品洞察信息
     * @param response
     * @param param
     * @param dbLang
     */
    void prodEffectExport(HttpServletResponse response, ProdEffectParam param, Integer dbLang);


    /**
     * 添加商品模板的下拉数量列表
     * @param shopId
     * @param sheet
     * @param workbook
     */
    void dropDownList(Long shopId, Sheet sheet, Workbook workbook, LangConfig langConfig);

    /**
     * 获取店铺签约的平台分类导出模板
     * @param shopId
     * @return
     */
    List<Category> listPlatformCategory(Long shopId);

}
